package com.dormitory.management.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dormitory.management.system.entity.Cost;
import com.dormitory.management.system.req.CostPageReq;
import com.dormitory.management.system.req.CostPayReq;
import com.dormitory.management.system.req.CostSaveReq;
import com.dormitory.management.system.resp.CostResp;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dormitory.managemnet.util.core.Result;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import com.google.zxing.common.BitMatrix;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 水电费用表 服务类
 * </p>
 *
 * @author
 * @since 2021-12-17
 */
public interface CostService extends IService<Cost> {
    /**
     * 添加水电记录
     * @param req 插入内容
     * @return
     */
    boolean save(CostSaveReq req);

    /**
     * 删除水电记录
     * @param id 水电记录id
     * @return
     */
    boolean delete(Long id);

    /**
     * 更新缴费状态
     * @param req
     * @return
     */
    String updateStatus(HttpServletRequest req);

    /**
     * 获取缴费二维码图片
     * @param id 水电记录id
     * @return
     */
    BitMatrix pay(Long id);

    /**
     * 根据查询条件分页查询
     * @param req 查询条件
     * @return 分页列表
     */
    IPage<CostResp> getPage(CostPageReq req);


    Result importWeekCheckByExcel(String username, MultipartFile file) throws IOException;
}
